<?php
	include("config.php");
	session_start();
	if($_SERVER["REQUEST_METHOD"]=="POST")
	{
		$username = addslashes($_POST['name']);
		$password = md5(addslashes($_POST['pass']));
		
		$sql ="SELECT * FROM Customer WHERE email='$username' AND password='$password'";
		$result = mysql_query($sql);
		$count = mysql_num_rows($result);		
		if($count==1)
		{
			session_register("myusername");
			$_SESSION['login_user'] = $username;
			$_SESSION['logged_in'] = true;
			header("location:about.php");
		}
		else
			$error="Your email or password is invalid";
	}
?>
<!DOCTYPE html>
<html lang="en">
<?php include('../inc/head.php'); ?>
<body>	 
	 <?php
	 	if($_SESSION['logged_in']===true) 
			include('../inc/nav2.php');
		else	
	 		include('../inc/nav.php');	 
	 ?>     
	 <div class="container">
	 	<ul class="nav nav-tabs">
  			<li>
    			<a href="contact.php">Contact Us</a>
  			</li>
  			<li class="active"><a href="about.php">About Us</a></li>  
      <div class="row">
      	<center>
      		<div class="span10">
          		<u><h2>About Us</h2></u>  
          		<p>This is a final project that I had to create for my Web Server Programming class in the Fall 2012 semester. On this site you are supposed to buy items and while you decide on which items to buy you can look at the recent twitter feed for the city of New Paltz where we are headquartered.</p>    	
        </div>
        </center>        
      </div>          
     <hr>
      <footer>
        <p>&copy; Company 2012</p>
      </footer>
    </div> <!-- /container -->
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="../inc/bootstrap/js/jquery.js"></script>
    <script src="../inc/bootstrap/js/bootstrap-min.js"></script>
</body>
</html>